package com.qf.feign.fallback;

import com.qf.feign.GoodsFeign;
import feign.hystrix.FallbackFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class MyFallbackFactory implements FallbackFactory<GoodsFeign> {
    @Autowired
    GoodsFallback goodsFallback;
    @Override
    public GoodsFeign create(Throwable throwable) {
        throwable.printStackTrace();
        return goodsFallback;
    }
}
